package com.hzncc.flowable_diboot.payment.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.diboot.core.entity.BaseModel;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 合同收款 Entity 定义
 *
 * @author MyName
 * @version 1.0
 * @date 2024-10-30
 * Copyright © MyCorp
 */
@TableName("mdl_payment_contract")
@Getter
@Setter
@Accessors(chain = true)
public class PaymentContract extends BaseModel {
    private static final long serialVersionUID = 1693697035346552393L;
    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 回款登记ID
     */
    @NotNull(message = "回款登记ID不能为空")
    @Length(max = 32, message = "回款登记ID长度应小于32")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String paymentRegisterId;

    /**
     * 成本中心
     */
    @TableField()
    private String costCenter;

    /**
     * 销售区域
     */
    @TableField()
    private String salesArea;

    /**
     * Sap客户Id
     */
    @Length(max = 100, message = "Sap客户Id应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String sapCustomer;

    /**
     * Sap客户编号
     */
    @Length(max = 100, message = "Sap客户编号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String sapCustomerCode;

    /**
     * 是否外部收款
     */
    @TableField()
    private String externalReceived;

    /**
     * 合同收款类别
     */
    @TableField()
    private String paymentContractCategory;

    /**
     * 应收已开票和应收未开票
     */
    @TableField()
    private String invoiceSelect;

    /**
     * 公司合同类型
     */
    @TableField()
    private String companyContractsType;

    /**
     * 预收金额
     */
    @TableField()
    private BigDecimal advanceAmount;

    /**
     * 销售员
     */
    @Length(max = 100, message = "销售员长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String saler;

    /**
     * 预收备注
     */
    @Length(max = 100, message = "预收备注长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String preRemark;

    /**
     * 合同金额
     */
    @TableField()
    private BigDecimal contractAmount;

    /**
     * 合同已收金额
     */
    @TableField()
    private BigDecimal contractReceivedAmount;

    /**
     * 合同剩余金额
     */
    @TableField()
    private BigDecimal contractRemainingAmount;

    /**
     * 本次收款金额
     */
    @TableField()
    private BigDecimal currentReceivedAmount;

    /**
     * 收款时间
     */
    @TableField()
    private LocalDateTime receivedTime;

    /**
     * 传阅
     */
    @Length(max = 100, message = "传阅长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String copyRead;

    /**
     * 备注
     */
    @Length(max = 100, message = "备注长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String remark;

    /**
     * 开票时间
     */
    @TableField()
    private LocalDateTime invoiceTime;

    /**
     * 手续费
     */
    @TableField()
    private BigDecimal commission;

    /**
     * 审核意见
     */
    @Length(max = 100, message = "审核意见长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String auditReason;

    /**
     * 流程实例ID
     */
    @Length(max = 100, message = "流程实例ID长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String instanceId;

    /**
     * 流程状态
     */
    @Length(max = 100, message = "流程状态长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String processState;

    /**
     * 撤销 0 否 1 是
     */
    @TableField
    private Integer wasted;

}